﻿using System;
using System.Collections.Generic;

namespace FBProjectTest.MockObjects.MSProject
{
    public class ResourcesMock : Microsoft.Office.Interop.MSProject.Resources
    {
        private List<ResourceMock> InternalResources = new List<ResourceMock>();

        public Microsoft.Office.Interop.MSProject.Resource Add([System.Runtime.InteropServices.OptionalAttribute]object Name, [System.Runtime.InteropServices.OptionalAttribute]object Before)
        {
            if (Name != null)
            {
                var resource = new ResourceMock(Name.ToString());
                InternalResources.Add(resource);
                return resource;
            }
            else
            {
                return null;
            }
        }

        public int Count
        {
            get { return InternalResources.Count; }
        }

        public System.Collections.IEnumerator GetEnumerator()
        {
            return InternalResources.GetEnumerator();
        }

        public Microsoft.Office.Interop.MSProject.Resource this[object Index]
        {
            get { return InternalResources[(int)Index - 1]; }
        }

        #region Not Implemented Microsoft.Office.Interop.MSProject.Resources Members

        public Microsoft.Office.Interop.MSProject.Application Application
        {
            get { throw new NotImplementedException(); }
        }

        public Microsoft.Office.Interop.MSProject.Project Parent
        {
            get { throw new NotImplementedException(); }
        }

        public Microsoft.Office.Interop.MSProject.Resource get_UniqueID(int Index)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
